package com.example.e_comm.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//import com.example.e_comm.entity.Permission;
import java.time.LocalDateTime;
import java.util.List;

//角色管理

@Data
@TableName("roles")
@NoArgsConstructor
@AllArgsConstructor
public class Role {
        public Role(Long id, String name, String description, String rolekdy){
            this.id = id;
            this.name = name;
            this.description = description;
            this.rolekdy = rolekdy;
            this.status = 1;
            this.deleted = 0;
            this.createTime = LocalDateTime.now();
            this.updateTime = LocalDateTime.now();
        }
        @TableId(type = IdType.AUTO)
        private Long id;
        private String name;//角色名
        private String description;//描述

        @TableField(value = "role_key")
        private String rolekdy;
        private Integer status;

        @TableLogic(value = "0", delval = "1")
        private Integer deleted;

        @TableField(value = "create_time", fill = FieldFill.INSERT)
        private LocalDateTime createTime = LocalDateTime.now();

        @TableField(value = "update_time", fill = FieldFill.UPDATE)
        private LocalDateTime updateTime = LocalDateTime.now();

        @TableField(exist = false)
        private List<Permission> permissionIds;

    public Role(long l, String testAdmin, String 测试管理员, String s) {
    }
}
